import {knowledgeBaseRequest} from '@/utils/request'

/**
 * 查询知识库列表
 * @returns 
 */
export const getknowledges = () =>
    knowledgeBaseRequest.get('/knowledgeBase/list');

/**
 * 创建知识库
 * @param {*} param0 
 * @returns 
 */
export const knowledgeAdd = (data) =>
    knowledgeBaseRequest.post('/knowledgeBase/add',data);


/**
 * 删除知识库
 * @param {*} param0 
 * @returns 
 */
export const knowledgeDel = (data) =>
    knowledgeBaseRequest.post(`/knowledgeBase/delete/`,data);

/**
 * 根据知识库id加载知识库文件列表
 * @param {*} kbId 
 * @returns 
 */
export const getBykbIdFilesList = (kbId) =>
    knowledgeBaseRequest.get(`/knowledgeBase/getBykbIdList`,{ params: { kbId } });

export const uploadFile = (data) =>
    knowledgeBaseRequest.post(`/knowledgeBase/upload`,data,{
        headers: {
            'Content-Type': 'multipart/form-data'
        },
    });